/* 现代化美观样式 */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', 'San Francisco', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #f0f2f5;
    height: 100vh;
    margin: 0;
    padding: 0;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* 聊天容器 - 有阴影和圆角的卡片设计 */
.chat-container {
    display: flex;
    flex-direction: column;
    height: 95vh;
    width: 85%;
    max-width: 1100px;
    background-color: white;
    border-radius: 16px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

/* 头部样式 - 现代化渐变背景 */
.chat-header {
    background: linear-gradient(135deg, #2374e1 0%, #4e95ed 100%);
    padding: 20px;
    text-align: center;
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header h1 {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: 5px;
    letter-spacing: 0.2px;
}

.chat-header p {
    font-size: 0.9rem;
    font-weight: 400;
    opacity: 0.9;
}

/* 聊天框 - 优雅的视觉设计 */
#chatbox {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    background-color: white;
    margin-bottom: 8px;
    scroll-behavior: smooth;
}

/* 美化滚动条 */
#chatbox::-webkit-scrollbar {
    width: 6px;
}

#chatbox::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

#chatbox::-webkit-scrollbar-thumb {
    background: #d1d1d1;
    border-radius: 10px;
}

#chatbox::-webkit-scrollbar-thumb:hover {
    background: #aaa;
}

/* 输入容器 - 现代风格 */
.input-container {
    display: flex;
    padding: 16px 24px 24px;
    background-color: white;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
}

#userInput {
    flex: 1;
    padding: 14px 18px;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    font-size: 16px;
    margin-right: 12px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    transition: all 0.2s ease;
}

#userInput:focus {
    outline: none;
    border-color: #2374e1;
    box-shadow: 0 2px 8px rgba(35, 116, 225, 0.2);
}

#sendButton {
    background-color: #2374e1;
    color: white;
    border: none;
    padding: 0 24px;
    border-radius: 24px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 500;
    transition: all 0.2s ease;
    min-width: 100px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
}

#sendButton:hover {
    background-color: #1a65d4;
    box-shadow: 0 2px 8px rgba(26, 101, 212, 0.3);
    transform: translateY(-1px);
}

#sendButton:disabled {
    background-color: #c5d6f2;
    transform: none;
    box-shadow: none;
    cursor: not-allowed;
}

/* 消息样式 - 现代气泡设计 */
.message {
    margin-bottom: 22px;
    padding: 14px 18px;
    border-radius: 18px;
    max-width: 80%;
    line-height: 1.5;
    animation: fadeIn 0.3s ease;
    position: relative;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    margin-left: auto;
    background-color: #e9f3ff;
    color: #11417d;
    border-bottom-right-radius: 4px;
}

.ai-message {
    margin-right: auto;
    background-color: #f5f7f9;
    color: #2e3b4e;
    border-bottom-left-radius: 4px;
}

.system-message {
    margin-left: auto;
    margin-right: auto;
    max-width: 90%;
    background-color: #fff9e6;
    color: #7a5c00;
    font-style: italic;
    text-align: center;
    border-radius: 12px;
}

.sender {
    font-weight: 600;
    margin-right: 8px;
    display: inline-block;
    margin-bottom: 6px;
    color: #555;
    font-size: 0.9em;
}

.content {
    word-wrap: break-word;
}

/* 工具信息样式 - 更精致的按钮 */
.tool-info {
    margin-top: 12px;
}

.more-button {
    background-color: #f7f9fc;
    border: 1px solid #e0e7ff;
    border-radius: 14px;
    padding: 6px 12px;
    cursor: pointer;
    font-size: 12px;
    color: #5277b4;
    transition: all 0.2s ease;
    font-weight: 500;
}

.more-button:hover {
    background-color: #e9f0ff;
    color: #2374e1;
}

/* 对话框样式 - 更精致的设计 */
.tool-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease;
}

.tool-dialog-content {
    background-color: white;
    padding: 28px;
    border-radius: 16px;
    width: 90%;
    max-width: 650px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.tool-dialog h3 {
    margin-top: 0;
    color: #2374e1;
    border-bottom: 1px solid #eaeff8;
    padding-bottom: 15px;
    margin-bottom: 20px;
    font-weight: 600;
}

.tool-dialog h4 {
    margin: 18px 0 10px;
    color: #4a5568;
    font-weight: 600;
}

.tool-parameters, .tool-result {
    background-color: #f7fafc;
    padding: 16px;
    border-radius: 10px;
    overflow-x: auto;
    white-space: pre-wrap;
    font-family: 'SF Mono', 'Menlo', monospace;
    font-size: 13px;
    margin-bottom: 12px;
    border: 1px solid #edf2f7;
    line-height: 1.6;
}

.tool-parameters {
    color: #2d3748;
}

.tool-result {
    color: #2c5282;
    background-color: #ebf4ff;
}

.dialog-close-button {
    margin-top: 24px;
    padding: 12px 20px;
    background-color: #2374e1;
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: block;
    width: 100%;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.dialog-close-button:hover {
    background-color: #1a65d4;
    box-shadow: 0 4px 12px rgba(26, 101, 212, 0.3);
    transform: translateY(-2px);
}